---
- name: Start docker container
  hosts: nodes
  become: true
  tasks:
    - name: git pull project
      git:
        repo: 'https://github.com/djsasha777/iot.git'
        dest: /home/iot/
        clone: yes
        update: yes
    - name: Tear down backend services
      community.docker.docker_compose:
        project_src: /home/iot/backend
        state: absent
    - name: Create and start backend services
      community.docker.docker_compose:
        project_src: /home/iot/backend
      register: output
